#include <stdio.h>
#define FINITY 5000
#define M 20

typedef char vertextype;
typedef int edgetype;
typedef struct {
    vertextype vexs[M];
    edgetype edges[M][M];
    int n, e;
} Mgraph;